package com.hc.radius.command;

import java.util.List;

import com.hc.radius.service.Const;
import com.hc.util.Util;


public class LogoutCommand extends Command {

	
	public LogoutCommand() {
		 servicename = Const.MSG_SERVICE_NAME_SRVM;
	}

	@Override
	public int getLen(CommandParam cmdp) {
		int len = 60 + Const.CMD_LOGOUT.length ;
		len += Util.getLen(cmdp.name);
		return len;
	}

	@Override
	public void addCmdContent(List<Byte> list, CommandParam cmdp) {
		int len = Const.CMD_LOGOUT.length;
		CommandWrap.addByte(list,Const.CMD_LOGOUT);
		List<Byte> temp =  Util.toByte( Util.toHexString(cmdp.name));
		len += temp.size();
		list.addAll(temp);
		CommandWrap.addTail(list, len);		
	}
	 
}